package org.xteam.sled.semantic.exp;


public class ExpSub extends ExpBinary {

	public ExpSub(Exp left, Exp right) {
		super(left, right);
	}
	
	public boolean equals(Object o) {
		return (o instanceof ExpSub)
			&& ((ExpSub)o).left.equals(left)
			&& ((ExpSub)o).right.equals(right);
	}
	
	@Override
	protected TermList toTermList(boolean neg, TermList answers) {
		return left.toTermList(neg, right.toTermList(! neg, answers));
	}

	@Override
	public void visit(IExpVisitor visitor) {
		visitor.visitSub(this);
	}
	
	public String toString() {
		return "(" + left + " - " + right + ")";
	}


}
